 VBScript У̱ΪࣺSub ̺ Function ̡

Sub 
Sub ǰ Sub  End Sub ֮һ VBScript 䣬ִвֵSub ̿ʹòɵù̴ݵĳʽ Sub κβ Sub  ()

 Sub ʹеģõģVBScript  MsgBox  InputBoxʾûϢȻʾЩϢĽʹ VBScript  Function ɡ˹֮ʾ

 Sub ConvertTemp()
    temp = InputBox("뻪¶ȡ", 1)
    MsgBox "¶Ϊ " & Celsius(temp) & " ϶ȡ"
 End Sub
Function 
Function ǰ Function  End Function ֮һ VBScript 䡣Function  Sub ƣ Function ̿ԷֵFunction ̿ʹòɵù̴ݵĳʽ Function κβ Function  ()Function ͨһֵֵڹ̵иġFunction ֵ Variant

ʾУCelsius ϶ȻΪ϶ȡSub  ConvertTemp ô˺ʱֵıݸصù̲ʾϢС

 Sub ConvertTemp()
     temp = InputBox("뻪¶ȡ", 1)
     MsgBox "¶Ϊ " & Celsius(temp) & " ϶ȡ"
 End Sub

 Function Celsius(fDegrees)
     Celsius = (fDegrees - 32) * 5 / 9
 End Function
̵ݽ
̴ݵ;ʹòΪҪݸ̵ݵռλκЧıʹ Sub  Function 䴴ʱ֮šавöŷָ磬ʾУfDegrees Ǵݸ Celsius ֵռλ 

 Function Celsius(fDegrees)
    Celsius = (fDegrees - 32) * 5 / 9
 End Function
Ҫӹ̻ȡݣʹ Function ̡סFunction ̿ԷֵSub ֵ̲

ڴʹ Sub  Function 
 Function ʱڱֵҶ˻ʽС磺

 Temp = Celsius(fDegrees)
 

 MsgBox "¶Ϊ " & Celsius(fDegrees) & " ϶ȡ"
 Sub ʱֻвֵֵ֮ʹöŷָʹ Call 䣬ʹ˴䣬뽫в֮С

ʾʾ˵ MyProc ̵ַʽһʹ Call 䣻һʹáַʽЧͬ

 Call MyProc(firstarg, secondarg)
 MyProc firstarg, secondarg
ע⵱ʹ Call еʱűʡԡ
